{
 "cells": [
  {
   "cell_type": "code",
   "execution_count": 26,
   "metadata": {},
   "outputs": [],
   "source": [
    "from sdm.utils import calculate_probabilities"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 29,
   "metadata": {},
   "outputs": [],
   "source": [
    "bits = 256\n",
    "cdf = calculate_probabilities(bits)"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": 30,
   "metadata": {},
   "outputs": [
    {
     "name": "stdout",
     "output_type": "stream",
     "text": [
      "Radius: 103 (p=0.001067)\n",
      "\n",
      "98 0.000106566561594\n",
      "99 0.000174241902136\n",
      "100 0.000280492186788\n",
      "101 0.000444601537339\n",
      "102 0.000693983393569\n",
      "103 0.00106684558638\n",
      "104 0.00161538323541\n",
      "105 0.0024094567845\n",
      "106 0.00354063702894\n",
      "107 0.00512640372676\n"
     ]
    }
   ],
   "source": [
    "for idx, p in enumerate(cdf):\n",
    "    if p > 0.001:\n",
    "        break\n",
    "        \n",
    "print 'Radius: {} (p={:.6f})'.format(idx, cdf[idx])\n",
    "print ''\n",
    "\n",
    "for i in range(idx-5, idx+5):\n",
    "    print i, cdf[i]"
   ]
  },
  {
   "cell_type": "code",
   "execution_count": null,
   "metadata": {},
   "outputs": [],
   "source": []
  }
 ],
 "metadata": {
  "kernelspec": {
   "display_name": "Python 2",
   "language": "python",
   "name": "python2"
  },
  "language_info": {
   "codemirror_mode": {
    "name": "ipython",
    "version": 2
   },
   "file_extension": ".py",
   "mimetype": "text/x-python",
   "name": "python",
   "nbconvert_exporter": "python",
   "pygments_lexer": "ipython2",
   "version": "2.7.10"
  }
 },
 "nbformat": 4,
 "nbformat_minor": 2
}
